/**
 * Copyright (c) 2019 xstgongyi.org
 * All rights reserved.
 */
package org.xstgongyi.eduaid.controller;

import org.xstgongyi.eduaid.dataobject.ProjectPhaseDO;
import org.xstgongyi.eduaid.bo.ProjectPhaseStatus;
import org.xstgongyi.eduaid.dataobject.ProjectDO;
import org.xstgongyi.eduaid.dataobject.SemesterDO;

/**
 * @author oldcrane<br/>
 * @created 2019-04-03
 */
public class ProjectPhaseVO {

	private Integer id;
	private Integer projectId;
	private String projectName;
	private Integer semesterId;
	private String semesterName;
	private ProjectPhaseStatus status;

	public static ProjectPhaseVO of(ProjectPhaseDO projectPhaseDO) {
		ProjectPhaseVO vo = new ProjectPhaseVO();
		vo.setId(projectPhaseDO.getId());
		vo.setProjectId(projectPhaseDO.getProjectId());
		vo.setSemesterId(projectPhaseDO.getSemesterId());
		vo.setStatus(projectPhaseDO.getStatus());
		return vo;
	}

	public void addProjectInfo(ProjectDO projectDO) {
		if (null != projectDO) {
			this.setProjectName(projectDO.getName());
		}
	}

	public void addSemesterInfo(SemesterDO semesterDO) {
		if (null != semesterDO) {
			this.setSemesterName(semesterDO.getName());
		}
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getProjectId() {
		return projectId;
	}

	public void setProjectId(Integer projectId) {
		this.projectId = projectId;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public Integer getSemesterId() {
		return semesterId;
	}

	public void setSemesterId(Integer semesterId) {
		this.semesterId = semesterId;
	}

	public String getSemesterName() {
		return semesterName;
	}

	public void setSemesterName(String semesterName) {
		this.semesterName = semesterName;
	}

	public ProjectPhaseStatus getStatus() {
		return status;
	}

	public void setStatus(ProjectPhaseStatus status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "ProjectPhaseVO [id=" + id + ", projectId=" + projectId + ", projectName=" + projectName
				+ ", semesterId=" + semesterId + ", semesterName=" + semesterName + ", status=" + status + "]";
	}

}
